package day020;

import java.io.*;

public class ConversionDemo1 {
    public static void main(String[] args) throws IOException {
        OutputStreamWriter osw = new OutputStreamWriter(new
                FileOutputStream("D:\\day020\\conversion.txt"), "GBK");
        osw.write("远桥之下泛莲舟");
        osw.write("\r\n");
        osw.write("岱岩石上松溪流");
        osw.write("\r\n");
        osw.write("万仞翠山梨亭在");
        osw.write("\r\n");
        osw.write("莫问空谷声悠悠");
        osw.write("\r\n");
        osw.close();

        InputStreamReader isr = new InputStreamReader(new
                FileInputStream("D:\\day020\\conversion.txt"), "GBK");
        int ch;
        while ((ch = isr.read()) != -1) {
            System.out.print((char) ch);
        }

        isr.close();

    }
}
